<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		   var arr=[1,2,3,4,5,6];
		   function Join(arr,opa){
		     var str=0;
		     for (var i=0;i<arr.length;i++) {
				if (i==arr.length-1) {
					str=str+arr[i];
				}else{
					str=str+arr[i]+opa;
				}
			}
			console.log(str);
		}
		Join(arr,',');
	</script>
</head>
<body>
	
</body>
</html>